package com.onepower.core.domain.mapper;

import com.onepower.core.domain.response.MatchCheckInfo;
import com.onepower.core.domain.response.MatchScheduleInfo;
import com.onepower.core.modules.repository.entity.extend.MatchScheduleExtend;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface MatchScheduleInfoMapper {
    MatchScheduleInfoMapper MAPPER = Mappers.getMapper(MatchScheduleInfoMapper.class);

    @Mapping(source = "matchScheduleExtend.match.matchName", target = "matchName")
    @Mapping(source = "matchScheduleExtend.matchPlace.placeName", target = "matchPlaceName")
    MatchScheduleInfo converterExtToInfo(MatchScheduleExtend matchScheduleExtend);

    List<MatchScheduleInfo> converterExtToInfoList(List<MatchScheduleExtend> matchScheduleExtendList);

    @Mapping(source = "matchScheduleExtend.match.matchName", target = "matchName")
    @Mapping(source = "matchScheduleExtend.matchPlace.placeName", target = "matchPlaceName")
    MatchCheckInfo converterExtToCheckInfo(MatchScheduleExtend matchScheduleExtend);

    List<MatchCheckInfo> converterExtToCheckInfoList(List<MatchScheduleExtend> matchScheduleExtendList);

}
